<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>kafka-test</title>
    <script src="js/jquery-3.4.0.min.js"></script>
</head>
<body>
<button id="click">点击</button>
<button id="job_collect">收藏</button>
<button id="cv_send">投简历</button>
<button id="cv_upload">上传简历</button>

</body>

<script>
    var opt = ["click","job_collect","cv_send","cv_upload"];
    var info = { user_id :"test",
        act_time : null,
        job_code : "拉勾集团",
        action:'' }
    $(document).ready(function(){
        opt.forEach(op=>{
            $('#'+op).click(function(){
                info["action"] = op
                info["act_time"] =  new Date()
                //  console.log(JSON.stringify(info))
               // alert(JSON.stringify(info));
                $.ajax({
                    url: "http://192.168.52.104/kafka/log",
                    type: "POST",
                    dataType: "json",
                    data:JSON.stringify(info)
                })
            })
        })

    })

</script>
</html>